\documentclass[12pt]{article}
\usepackage{calc,fancyhdr}
\usepackage[hmargin=.5in,vmargin=.75in,
            footskip=.25in,headsep=.5in-\headheight]{geometry}

% Template solution to Exercise 3.

% Common formatting macros for CSC165.
\usepackage{amsmath,amssymb}
\input{macros-165}

% Page layout: stretch text to fill up page.
\flushbottom

% Headings.
\pagestyle{fancy}
\let\headrule\empty
\let\footrule\empty
\lhead{CSC\,165\,H1S}
\chead{Homework Exercise \#\,4}
\rhead{Winter 2014}

\begin{document}

\begin{large}
  \noindent
  Name: Robert Staskiewicz \hfill CDF login name: c3staski\\[0.5cm]
  Partner: Ekam Shahi    \hfill CDF login name: c3shahie
\end{large}

\medskip

\noindent
\rule{\textwidth}{.5pt}

\subsection*{Topic: Equivalent logical statements}

\medskip

\begin{enumerate}
 
       
    % place solution to question 1 below
    \item
    	$ \exists x \in D,\forall y \in D, [P(x) \land (P(y) \implies y = x)] $\\
    	If there is exactly one x such that P(x), then P(x) is true, and for every P(y), if P(y) is true, then x must be equal to y.\\
    	What this means is: If you choose an x, y must equal x, for y to be unique for each x.
    	
    % place solution to question 2 below

    \item
     \begin{enumerate}
     \item
  $[(P \implies Q) \land  \neg Q] \implies \neg P$\\
  $[ (\neg P \lor Q) \land \neg Q] \implies \neg P$\ (Implication Rule)\\
  $[ (\neg P \land \neg Q) \lor (Q \land \neg Q)]\implies \neg P$ \ (Distributive Rule)\\
  $ (\neg P \land \neg Q) \implies \neg P$ \ (Identity Rule)\\
  $ \neg (\neg P \land \neg Q) \lor \neg P$\ (Implication Rule) \\
  $ (P \lor Q) \lor \neg P $ (DeMogran's Law) \\
  $ (P \lor \neg P) \lor Q $  (Commutative Rule)\\
  $ \True \lor Q $\\
  
  As  we  see, True  \em or \em  anything  is  always  True. \\
    % place solution to question 3 below
	
   
    \item
    $[ ( P \lor Q) \land (P \lor \neg Q)] \implies P$ \\
    $ \neg [ ( P \lor Q) \land (P \lor \neg Q)] \lor P $ (Implication Rule) \\
    $ [ \neg(P \lor Q) \lor \neg(P \lor \neg Q)] \lor P $ (DeMorgan's Law)  \\
    $ [(\neg P \land \neg Q) \lor (\neg P \land  Q)] \lor P $ (DeMorgan's Law)  \\
    $ [(\neg Q \land \neg P) \lor (\neg Q \land  P)] \lor P $ (Commutative Law)  \\
    $[(\neg Q \lor Q) \land \neg P)] \lor P $ (Distributive Property)  \\
    $ \neg P \lor P $ (Tautology)\\
    
    \item
    $ (P \implies Q) \implies [(R \lor P) \implies (R \lor Q)] $ \\   
    $ (P \implies Q) \implies [\neg(R \lor P) \lor (R \lor Q)] $  (Implication Rule) \\
    $ (P \implies Q) \implies [(\neg R \land \neg P) \lor (R \lor Q)] $  (DeMorgan's Law) \\
    $ (\neg P \lor Q) \implies [(\neg R \land \neg P) \lor (R \lor Q)] $ (Implication Rule) \\
    $ \neg (\neg P \lor Q) \lor [(\neg R \land \neg P) \lor (R \lor Q)] $ (Implication Rule) \\
    $ ( P \land \neg Q) \lor [(\neg R \land \neg P) \lor (R \lor Q)] $ (DeMorgan's Law) \\ 
    $ [( P \land \neg Q) \lor (\neg R \land \neg P)] \lor (R \lor Q) $ (Associative Rule) \\
    $ [(\neg R \land \neg P) \lor (R \lor Q)] \lor ( P \land \neg Q)  $ (Commutative Rule) \\
    $ [\neg(R \land P) \lor (R \lor Q)] \lor ( P \land \neg Q)  $ (DeMorgan's Law) \\
    $ [(R \land P) \implies (R \lor Q)] \lor ( P \land \neg Q) $ (Implication Rule)\\
    $ [(R \land P) \implies (R \lor Q)] \lor ( P \land \neg Q) $ (Tautology) \\
    
    When $ (R \land P) $ is True, $(R \lor Q)$ cannot be False. \\ If $ [(R \land P) \implies (R \lor Q)]$ is always True, then we can disregard $( P \land \neg Q)$.\\  Therefore, we have a Tautology, and the whole statement is always True.
    
    
      
	\end{enumerate}
    % place solution to question 4 below

    \item
    
    Prove that $[(P \lor Q) \land R]$ and $ [P \lor (Q \land R)]$ are not logically equivalent:\\
    Suppose P is True\\
    Suppose Q is False\\
    Suppose R is False\\
    Then, $[(P \lor Q) \land R)]$  is  False.\\
    but, $[P \lor (Q \land R)]$  is  True.\\
    Therefore, These two statements are not logically equivalent.
 
\end{enumerate}

\medskip

\noindent
\rule{\textwidth}{.5pt}

\end{document}
